const avatars = [
  'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', // Alipay
  'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', // Angular
  'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', // Ant Design
  'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', // Ant Design Pro
  'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png', // Bootstrap
  'https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png', // React
  'https://gw.alipayobjects.com/zos/rmsportal/ComBAopevLwENQdKWiIn.png', // Vue
  'https://gw.alipayobjects.com/zos/rmsportal/nxkuOJlFJuAUhzlMTCEe.png', // Webpack
];

const getAppPageList = [
  {
    id: '1',
    logo: avatars[0],
    appZhName: 'react应用',
    appName: 'sub-app1',
    appPath: 'http://localhost:8081/',
    member: '科学搬砖组',
    description: '那是一种内在的东西，他们到达不了，也无法触及的',
    updatedAt: new Date(),
  },
  {
    id: '2',
    logo: avatars[1],
    appZhName: 'vue应用',
    appName: 'children-app-2',
    appPath: 'http://localhost:9093/',
    member: '科学搬砖组',
    description: '那是一种内在的东西，他们到达不了，也无法触及的',
    updatedAt: new Date(),
  },
  {
    id: '3',
    logo: avatars[3],
    appZhName: 'react应用',
    appName: 'sub-app1',
    appPath: 'http://localhost:8081/',
    member: '科学搬砖组',
    description: '那是一种内在的东西，他们到达不了，也无法触及的',
    updatedAt: new Date(),
  },
];

export default {
  'POST  /api/apps/pageList': getAppPageList,
  'POST  /api/apps/appInfo': (req, res) => {
    const { appName } = req.body;
    let appPath = 'http://localhost:8093/';
    // 在启动控制台查看日志
    console.log(req.body);
    if (appName == 'sub-app1') {
      appPath = 'http://localhost:8081/';
    }
    let appInfo = {
      appName: appName,
      appPath: appPath,
      des: '蚂蚁金服－某某某事业群－某某平台部－某某技术部－UED',
    };
    res.send(appInfo);
  },
};
